package behavioral_pattern.iterator_pattern;

import structural_pattern.decorator_pattern.ListBox;

import java.util.ArrayList;
import java.util.List;

/**
 * 抽象聚合类
 */
public  abstract  class AbstractObjectList {
    protected List<Object> objectList = new ArrayList<>();

    public AbstractObjectList(List<Object> objectList) {
        this.objectList = objectList;
    }

    public void addObject(Object o){
        this.objectList.add(o);
    }
    public void removedObject(Object o){
        this.objectList.remove(o);
    }
    public List getObjects(){
        return this.objectList;
    }
    //声明创建迭代器对象的抽象工厂方法
    public abstract AbstractIterator createIterator();
}
